<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <!--<h1 :style="{key(属性名): value(属性值)}">{{message}}</h1>-->
  <!--  <h1 :style="{color: 'red'}">{{message}}</h1>-->
  <h1 :style="{color: color,fontSize: finalSize+'px',background: background}">{{message}}</h1>
  <h1 :style="getStyle()">{{message}}</h1>

</div>

<script src="../js/vue.js"></script>
<script>
  //let(变量)和const(常量)
  const app = new Vue({
    el: '#app',
    data: {
      message: '中国牛蛙！',
      color: 'red',
      finalSize: 100,
      background: 'blue'
    },
    methods: {
      getStyle: function (){
        return {color: this.color,fontSize: this.finalSize+'px',background: this.background};
      }
    }
  })
</script>
</body>
</html>